UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/sNbB8JeFzol1LxuVlkQKkFMCaALGgRS20KP/AZVRYE='
WHERE
key_id = '71ccd099c0a43abf78c1ee91888ccf15954cb5b6743ccbe42e116db0fc738e70'
AND (
token = '/sNbB8JeFzol1LxuVlkQKkFMCaALGgRS20KP/AZVRYE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)