UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nuprj2HimK504yyxHM36X2SdbR9igcNoRROvBHpNNDk='
WHERE
key_id = 'ad18f9436deac4c3fb49b1ed181334ba35259755a25fe3268ae0474b70761405'
AND (
token = 'nuprj2HimK504yyxHM36X2SdbR9igcNoRROvBHpNNDk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)