UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9Z4x7r2/2J0mkNA2LJ6aENRH4dL95zTfmTAno5+THs8='
WHERE
key_id = '984f09c884bf9c3e0bf5d7a110906bdcf4b6e4136f9316908231b5d44b8f2d8e'
AND (
token = '9Z4x7r2/2J0mkNA2LJ6aENRH4dL95zTfmTAno5+THs8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)