UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EPJi2ju22kn9fWa5K8JV3ULcf1PCeLGBq/iQhD83gXM='
WHERE
key_id = '4c49f34127fafca20edae73bbdab16dc9d4dbcc2f7db1512af18c36d8543dbfc'
AND (
token = 'EPJi2ju22kn9fWa5K8JV3ULcf1PCeLGBq/iQhD83gXM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)