UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sK6RkanzOs4SfIBg4a1hZkb/cJ7iuMIXtTw5Q2DfMVg='
WHERE
key_id = '49aea09f39ac47c14bec6355c6d75ed04c7e388f86004be5a30318ae3bd25627'
AND (
token = 'sK6RkanzOs4SfIBg4a1hZkb/cJ7iuMIXtTw5Q2DfMVg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)