UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bjO6QG5NpN1rbfSI1oHx6vA33hauk6JOZnP2KQCczSw='
WHERE
key_id = '98d136c83f08277ca779212312eab9cba1f6fbe84a039a738f4113dc18e58650'
AND (
token = 'bjO6QG5NpN1rbfSI1oHx6vA33hauk6JOZnP2KQCczSw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)