UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IxgMpBMrGMdb05XM3/XBjRzal23bM16Wb7IVVFjWMJ8='
WHERE
key_id = 'dd997fcd6b686ec5dde7c52d4a0226c38d051e1b923d95dddce40a2eb9696c02'
AND (
token = 'IxgMpBMrGMdb05XM3/XBjRzal23bM16Wb7IVVFjWMJ8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)