UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jA0OWpgKo2s7WVku1CRgdWxIp80mqfAY2VceOD4N4FE=' 
WHERE 
  key_id = '498366704caa17ee50aaef18136c04d09dde94e80c475bebb59f976521fc283c' 
  AND (
    token = 'jA0OWpgKo2s7WVku1CRgdWxIp80mqfAY2VceOD4N4FE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031