UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cWDNwERcc2qo3Rk4Lq7IZCgWX7HJ4fzVWim+pUoYQlU='
WHERE
key_id = 'c8d75c69cc9b1823e68d83ae045bf41a2a7a73380e9537652d4a71fcb4fe1440'
AND (
token = 'cWDNwERcc2qo3Rk4Lq7IZCgWX7HJ4fzVWim+pUoYQlU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)