UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mnjFYy7Ft1c3EQDcLygW7f+IVyjlqVaPkAedOGkQf1Y=' 
WHERE 
  key_id = '74c9383508dc0b709463ac3d1778d9821f68e8d6b26d6c17cca08cf78fc3780b' 
  AND (
    token = 'mnjFYy7Ft1c3EQDcLygW7f+IVyjlqVaPkAedOGkQf1Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031