UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hZyCRMDt1nuMKcBRYji2VhTuDGuahyEdY7ZFRry/goY='
WHERE
key_id = 'aed16322c26c81aa65138dec338071244880f1fa0d50d8fa6cea2a2bfe696514'
AND (
token = 'hZyCRMDt1nuMKcBRYji2VhTuDGuahyEdY7ZFRry/goY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)