UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cXFWPAK7FI5po3P8/Upl5inK1jr9GK5YEN1qY9Eophw='
WHERE
key_id = '9dd8a8eda86c57b0b8a754977b4a83375f1bb44850d2bdc0ca6cffad413549cd'
AND (
token = 'cXFWPAK7FI5po3P8/Upl5inK1jr9GK5YEN1qY9Eophw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)