UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wNYEfXmknTPCfHgMPtnk3Bj9Ax8WeOb7pbffZB7HiYM=' 
WHERE 
  key_id = '9bb1386333675bdf0bbf0e3b572b0b46a3f8a56ad560cbc217431eea1fb88aa4' 
  AND (
    token = 'wNYEfXmknTPCfHgMPtnk3Bj9Ax8WeOb7pbffZB7HiYM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041