UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '42zKgmVrSdWr9SSGoKXjTCeSGEoKR6YXt1nDyCUF9GM='
WHERE
key_id = '7581ff987db5acd2fb6aef2171222e2dc7402ef600ee100e53d403455173f4c3'
AND (
token = '42zKgmVrSdWr9SSGoKXjTCeSGEoKR6YXt1nDyCUF9GM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)