UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VP/52A+x5/yRi3TcntEp16bkq2SbP00LOjwNoZIbOuA='
WHERE
key_id = 'e4df635cb1227a20194bd29dabe842753c758e90233f49003fd0c3a73aee87b1'
AND (
token = 'VP/52A+x5/yRi3TcntEp16bkq2SbP00LOjwNoZIbOuA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)