UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gp6BfSqGorLB38l/kjKS8poQCvJapHpu/Otdjll1Bsg='
WHERE
key_id = '8ff344217c5829ee1416cc2546a02de77637761d49c4ef3f6ab0ad9e96ced232'
AND (
token = 'gp6BfSqGorLB38l/kjKS8poQCvJapHpu/Otdjll1Bsg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)