UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2XA/gxWy1hBjDaHe7FgxYnCteh86+OOaazoZb64Rl+4='
WHERE
key_id = 'bbb7bbde8d2e327143ca0521efddfa0f5dc057fe61266391e40efe511b953f73'
AND (
token = '2XA/gxWy1hBjDaHe7FgxYnCteh86+OOaazoZb64Rl+4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)