UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0mqSN065HHdeEpCIJ+eIvnyt0T9p6oRx1UpyJNRFOc4='
WHERE
key_id = 'eb2665e939c820a0b4bdf006deee77ccd7f63d8febba7a987cf846f1d9fd34db'
AND (
token = '0mqSN065HHdeEpCIJ+eIvnyt0T9p6oRx1UpyJNRFOc4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)