UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oicY4V8Wef8HBAyP/B2bPxDXnDX4PAsXs5zQ7HGLMi8='
WHERE
key_id = 'f79f2ba7391de877e92d4f15cd0c28bff73df0e4b3be8f87a201e3268fad6e3a'
AND (
token = 'oicY4V8Wef8HBAyP/B2bPxDXnDX4PAsXs5zQ7HGLMi8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)