UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fvCxzs+QqTuXCsOQtQzs5KOUQaUL2hZrlKQ5Vjh0VU8=' 
WHERE 
  key_id = '6a707dfcc5a054bef09e6700a1670654ab816940650b99a4cae88000445b88fa' 
  AND (
    token = 'fvCxzs+QqTuXCsOQtQzs5KOUQaUL2hZrlKQ5Vjh0VU8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033