UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/6t0dAoSK8vfDabtnPnGytx6vYKhX4NNCXGW8DnE0b8='
WHERE
key_id = '41b858ed57d82904bfbe7f6e01b9c9d7e4aca56fc90416705b12c3ba82418bf0'
AND (
token = '/6t0dAoSK8vfDabtnPnGytx6vYKhX4NNCXGW8DnE0b8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)