UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fIBNA++XfKy1KsUQGKix3Otp9esKTUMSlwRIZ38iBCI='
WHERE
key_id = '860a85a8e1649cdf129d44826e9c73c7bdb53303ce95167ccd5a19a1c76c3be1'
AND (
token = 'fIBNA++XfKy1KsUQGKix3Otp9esKTUMSlwRIZ38iBCI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)