UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6cS2HpDzL1Slt1XfCRh6n7sdLtgTe4J/Ri0DG2KtG1A='
WHERE
key_id = '6a45753c22a88b12c2fde09b47fe821a0733ed6aea02feb92f9ba84843d1d614'
AND (
token = '6cS2HpDzL1Slt1XfCRh6n7sdLtgTe4J/Ri0DG2KtG1A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)