UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AoFW3R61Y4NWqkPA+ErX92NhW77jnNOYhTOV6haB4kk='
WHERE
key_id = '1cffce3751e990f902d8d8b8635b91221dd5bd3c7e5ca2914f7663d4db56781e'
AND (
token = 'AoFW3R61Y4NWqkPA+ErX92NhW77jnNOYhTOV6haB4kk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)