UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UBHlVCwmfpL/h2YUORnVj7Hk+75FEgJHIO2q9znciUo='
WHERE
key_id = 'cae54bee7cc58f9caef88f54942fe1247a6a3bcd32fcdd7c70b9ccc54beeddb1'
AND (
token = 'UBHlVCwmfpL/h2YUORnVj7Hk+75FEgJHIO2q9znciUo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)