UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'P4OAqKDj9amwhjS3naop9rNTlqHOsA1f7nC/R47//Jw=' 
WHERE 
  key_id = '46a9a69a60027bbecad69bef65cdc1ab201cab0ed3372153b7cba66caf68a4ef' 
  AND (
    token = 'P4OAqKDj9amwhjS3naop9rNTlqHOsA1f7nC/R47//Jw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00141