UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'I7l1dPNlyE7DP+bSlPQR2davPUKKk4cZg/UG+x7CQhs='
WHERE
key_id = '4f5728bb0a6d57e1cd93067c09b5a2199304cd9f1b325a1b4657217785f67a1b'
AND (
token = 'I7l1dPNlyE7DP+bSlPQR2davPUKKk4cZg/UG+x7CQhs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)