UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gTsJEhGZ4S78U0O+d8ERSSn8uHWSSay21lTSuG6BMbk='
WHERE
key_id = '5e1bee92d7d22792d37146df0ebc9cabff3c9e64dc7b920db0a0f6a14d55a8c4'
AND (
token = 'gTsJEhGZ4S78U0O+d8ERSSn8uHWSSay21lTSuG6BMbk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)