UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'j8Xcc8l0vPk7TxO4iUpZ9/OFysZwJ2cuv2J0tXKsucc='
WHERE
key_id = '3f4d771733fa2abfd8113d174a87ea48afb5153ee3efeea48a017897f07006d4'
AND (
token = 'j8Xcc8l0vPk7TxO4iUpZ9/OFysZwJ2cuv2J0tXKsucc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)