UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'D1cQs5zC428mRV7Wbqdj/fMvSqBLLCKcqriTWMzsCAc='
WHERE
key_id = '46cd9f03f4b0201e406be673b2c3d02164e1e7f295681a7bda0d72eabf04006a'
AND (
token = 'D1cQs5zC428mRV7Wbqdj/fMvSqBLLCKcqriTWMzsCAc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)