UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'g9XWiboFD/lSHBmkCPoalzq/jt/rRt0DXo12Skgca1k='
WHERE
key_id = '26b1cc62ca7328d28d719c43572ef3a3c6941edcb711152ab21771f99cb9b0fb'
AND (
token = 'g9XWiboFD/lSHBmkCPoalzq/jt/rRt0DXo12Skgca1k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)