UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jKmGAc5PQI3uCv/19OYyT5WOY8xjNjsXK8v5nu7DXkY=' 
WHERE 
  key_id = '02d575fe0602ee79a11efbd44a1378a4e42677f0e0223287603e104e07fd2fa5' 
  AND (
    token = 'jKmGAc5PQI3uCv/19OYyT5WOY8xjNjsXK8v5nu7DXkY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044