UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Tptzzkq/I5HMRqPAqk2xt5Amlby5tuc7bEFGiUjVBdU=' 
WHERE 
  key_id = '18a8c36752001f65d9e558cafe1265a0fd7e75915e7249ffeb1d821fae7b0b15' 
  AND (
    token = 'Tptzzkq/I5HMRqPAqk2xt5Amlby5tuc7bEFGiUjVBdU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017