UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KsUHYEzY6gtnlHwy00bimw9wQAdsQHXk9DHR0+siUkg='
WHERE
key_id = '73e74bf283b2f41c904d502495205a328e1c60a906686e048df1a00bd9cf203f'
AND (
token = 'KsUHYEzY6gtnlHwy00bimw9wQAdsQHXk9DHR0+siUkg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)