UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2Iar/YjV1nmHuM4CtcdyTgGQ4S1e9AD+gR1mpy+jX4g='
WHERE
key_id = '2763e4482d63fab23a2bf14ff8e7af691ddbcfcf7ae3f32a1f5bfe507ab3cd7c'
AND (
token = '2Iar/YjV1nmHuM4CtcdyTgGQ4S1e9AD+gR1mpy+jX4g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)