UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wLiga7XjvXCEzAobf7Z7PeWv2ToIeYKhTM4bw0sHzfQ='
WHERE
key_id = '28875fd86d03e409dc24792ab00d88e37bbb6f90d80e4d583efff001905057e1'
AND (
token = 'wLiga7XjvXCEzAobf7Z7PeWv2ToIeYKhTM4bw0sHzfQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)