UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'poKaowWqroQbY/SIfYrAxVOj9dkZjFQXkmJtgM9pHJU='
WHERE
key_id = 'e6fdb7ebf4c5e277c206465dba76cfe36af207d1b89322738b7c2672acba6ace'
AND (
token = 'poKaowWqroQbY/SIfYrAxVOj9dkZjFQXkmJtgM9pHJU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)