UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+LYuwbtgk40l5zcadOLpS5872sQxZkaiPVBQBWxXzP0='
WHERE
key_id = '66fba66bdaac26b6edef528e4e6852e9a456332c1d8a74a6f75b99c13de8df34'
AND (
token = '+LYuwbtgk40l5zcadOLpS5872sQxZkaiPVBQBWxXzP0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)