UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YP4u6tMcvoci0jqzfsPtKazJ3MKoLTW2MG8y5HniOEA=' 
WHERE 
  key_id = '18f9e6e5a3dbb01c775bfdd8a84c37a3272f9091cafeeea102f8f37cd9f1b5fb' 
  AND (
    token = 'YP4u6tMcvoci0jqzfsPtKazJ3MKoLTW2MG8y5HniOEA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049