UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Sj57efBe9EPrEuAGuPdMiE2xOV3RTvI1/Ng+4ZS0t1I='
WHERE
key_id = 'c4c4730ec83bdbd6d17e74f8b96b2f2db24c03a03bf99d98545787cdaa88a38a'
AND (
token = 'Sj57efBe9EPrEuAGuPdMiE2xOV3RTvI1/Ng+4ZS0t1I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)