UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1MUmJMr+3/zdSrcVEErxPYpGel2WH5OoYCPgRV1Ovc0=' 
WHERE 
  key_id = '3d76b81e492d81d934055a80a77e22b26a9995fe3e1ab48f2054bc4255607210' 
  AND (
    token = '1MUmJMr+3/zdSrcVEErxPYpGel2WH5OoYCPgRV1Ovc0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017