UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'r3dzVh3kIzDIp/P0jYI1BmSNxf3nGH9pTC25ONF2lA4=' 
WHERE 
  key_id = '0363cefb2f9d05537bc522ca30799fdbaaa1a54ae1271bb20c9b178cf898351b' 
  AND (
    token = 'r3dzVh3kIzDIp/P0jYI1BmSNxf3nGH9pTC25ONF2lA4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039