UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZRoijNCIBI6x38ebr74BWp0lNVbLmXa5HtqdoxIHgfg='
WHERE
key_id = '49fe128a349cae47ef57ca0888378167781dcf4385da77d2467f402d64add43c'
AND (
token = 'ZRoijNCIBI6x38ebr74BWp0lNVbLmXa5HtqdoxIHgfg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)