UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YlRxEw3rupYBHv7wwA3yJU8MVdQ4KvJZucaorEJUP9U=' 
WHERE 
  key_id = '51929f4c44e355893681a982f1431e02b231bcbfd055bb53c5c60b04838032a7' 
  AND (
    token = 'YlRxEw3rupYBHv7wwA3yJU8MVdQ4KvJZucaorEJUP9U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00060